define([], function () {
    var app = angular.module('App');
    app.factory('Project.Status', ['$q', '$http', function ($q, $http) {
        var extend = {};
        extend.getStatusGroup = function () {
            var _this = this;
            var defer = $q.defer();
            if (this.statusGroup) {
                defer.resolve(this.statusGroup);
            } else {
                $http.get('/metro/project/statusGroup', {
                    params: {
                        prjId: _this.prjId
                    }
                }).success(function (data) {
                    _this.statusGroup = data;
                    defer.resolve(data);
                });
            }

            return defer.promise;
        };
        return extend;
    }]);
});